import { createApp } from 'vue';
import App from './App.vue';
import { TUIComponents, TUICore, genTestUserSig } from './TUIKit';
// import TUICallKit
import { TUICallKit } from '@tencentcloud/call-uikit-vue';
// ant
import Antd from 'ant-design-vue';


const SDKAppID = 1400800054; // Your SDKAppID
const secretKey = 'da952eadd25735813888e18bf44ba090993cc482a24cd6787445002ea6bd060a'; //Your secretKey

//const aaa ='225364741';//location.search.split('=')[1];
//console.log(aaa);
// const userID ='798572472';//'123456780'; // User ID
const userID = location.search.split('=')[1]; // User ID

// init TUIKit
const TUIKit = TUICore.init({
  SDKAppID,
});
// TUIKit add TUIComponents
TUIKit.use(TUIComponents);
// TUIKit add TUICallKit
TUIKit.use(TUICallKit);


// login TUIKit
TUIKit.login({
  userID: userID,
  userSig: genTestUserSig({
    SDKAppID,
    secretKey,
    userID,
  }).userSig, // The password with which the user logs in to IM. It is the ciphertext generated by encrypting information such as userID.For the detailed generation method, see Generating UserSig
});


createApp(App)
    .use(TUIKit)
    .use(Antd)
    .mount('#app');
